package com.tan.androidtest.java;

/**
 * 测试JAVA初始化顺序
 */

public class TestInitOrder {

    static int b = 1;

    public static void main(String[] args) {
        // StringBuffer b = new StringBuffer("111");
        //test(b);
        System.out.println();
        Integer i=126;
    }

    public static void test(int a) {
        a = 11;
        System.out.println("==--a: " + a);
    }


}


class A {
    static int a;

    static {
        System.out.println(a + "父类的静态代码块");
    }

    {
        System.out.println("父类的代码块");
    }

    public A() {
        System.out.println("父类的构造方法");
    }

}

class B extends A {
    static int a;

    static {
        System.out.println(a + "子类的静态代码块");
    }

    {
        System.out.println("子类的代码块");
    }

    public B() {
        System.out.println("子类的构造方法");
    }


}